﻿using System;

namespace Meqs.Entity
{
    [Serializable]
    public class ScoreInputEntity
    {
        private int _itemID;
        private int _studentID;
        private int _type;
        private double _param;
        private double _score;
        private int _operator;

        public ScoreInputEntity()
        {
        }

        public ScoreInputEntity(int itemID, int studentID, int type, double param, double score)
        {
            _itemID = itemID;
            _studentID = studentID;
            _type = type;
            _param = param;
            _score = score;
        }

        public int ItemID
        {
            get { return _itemID; }
            set { _itemID = value; }
        }

        public int StudentID
        {
            get { return _studentID; }
            set { _studentID = value; }
        }

        public int Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public double Param
        {
            get { return _param; }
            set { _param = value; }
        }

        public double Score
        {
            get { return _score; }
            set { _score = value; }
        }

        public int Operator
        {
            get { return _operator; }
            set { _operator = value; }
        }

        public bool Equals(ScoreInputEntity other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._studentID == _studentID && other._itemID == _itemID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (ScoreInputEntity)) return false;
            return Equals((ScoreInputEntity) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (_studentID*397) ^ _itemID;
            }
        }
    }

    [Serializable]
    public class ScoreInputEntityWithCls : ScoreInputEntity
    {
        private int _causeID;

        public int CauseID
        {
            get { return _causeID; }
            set { _causeID = value; }
        }
    }


    [Serializable]
    public class TeacherInputEntity 
    {
        private int _itemID;
        private int _teacherID;
        private int _type;
        private double _param;
        private double _score;
        private int _operator;

        public TeacherInputEntity()
        { 
        }

        public TeacherInputEntity(int itemID, int teacherID, int type, double param, double score)
        {
            _itemID = itemID;
            _teacherID = teacherID;
            _type = type;
            _param = param;
            _score = score;
        }

        public int ItemID
        {
            get { return _itemID; }
            set { _itemID = value; }
        }

        public int TeacherID
        {
            get { return _teacherID; }
            set { _teacherID = value; }
        }

        public int Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public double Param
        {
            get { return _param; }
            set { _param = value; }
        }

        public double Score
        {
            get { return _score; }
            set { _score = value; }
        }

        public int Operator
        {
            get { return _operator; }
            set { _operator = value; }
        }
 
    }
}
